<?php

header('Content-Type:text/html;charset=gbk');

include '../include/common.inc.php';
if(!empty($sql)){
	$sql=stripslashes($sql);
           $sql=stripslashes($sql);
           $sql=stripslashes($sql);
           $sql=stripslashes($sql);
	preg_match_all('/\[(.*?)\]/', $sql, $matchs);
	$xml .= '<root>';
	foreach($matchs[1] as $_k=>$_v){
		$rs = $db->query(stripslashes($_v));
                     $num = $db->num_fields($rs);
		if($row = $db->fetch_array($rs, MYSQL_NUM)){
		     for($i=0; $i<$num; $i++){
                               $xml .= '<data value="'.$row[$i].'"/>'; 
		     }
                       }
	}
	$xml .= '</root>';
}

echo $xml;
 
?>
